Skip to content

Guard visual font setup without graphics context - #23

Open
koenvdheide wants to merge 1 commit into
cmzmasek:masterfrom
koenvdheide:codex/forester-visual-font-null-guard
Open

Guard visual font setup without graphics context#23
koenvdheide wants to merge 1 commit into
cmzmasek:masterfrom
koenvdheide:codex/forester-visual-font-null-guard

Conversation

@koenvdheide

Copy link
Copy Markdown

TreePanel uses getGraphics() while calculating text width for tree rendering. Swing can return null from Component.getGraphics() before a component has a graphics context. This guard keeps the existing default-font fallback in that case.

getGraphics() can return null before the panel has a graphics context. Keep the existing default-font fallback by only applying visual styles when a Graphics2D is available.
@koenvdheide
koenvdheide deleted the codex/forester-visual-font-null-guard branch May 28, 2026 13:40
@koenvdheide
koenvdheide restored the codex/forester-visual-font-null-guard branch May 28, 2026 13:41
@koenvdheide koenvdheide reopened this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant